<%@ page language="java" import="java.util.*" pageEncoding="UTF-8"%>
<%@taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<title>申请解绑设备</title>
<meta name="viewport" content="initial-scale=1, maximum-scale=1">
<link rel="shortcut icon" href="/favicon.ico">
<meta name="apple-mobile-web-app-capable" content="yes">
<meta name="apple-mobile-web-app-status-bar-style" content="black">

<link rel="stylesheet"
	href="//g.alicdn.com/msui/sm/0.6.2/css/sm.min.css">
<link rel="stylesheet"
	href="//g.alicdn.com/msui/sm/0.6.2/css/sm-extend.min.css">
	<jsp:include page="../inc/head.jsp" />
</head>
<body>
	<jsp:include page="../inc/header.jsp" />
	<%-- <header class="bar bar-nav">
		 <h1 class='title'>${appName}-移动端首页</h1> 
		
	</header> --%>
	<div class="content">
		<div class="content-block">
		<div class="am-cf am-padding am-padding-bottom-0">
		<br>
					<div class="am-fl am-cf">
						<strong class="am-text-primary am-text-lg">${pagetitle}</strong> /
						<small>${subtitle}</small>
					</div>
				</div>

				<hr>
			<!-- <h2>测试提交信息功能</h2>
			<p>测试提交信息功能</p>
			<p>
				<a href="5/irdc.do"
					class="button button-big">测试提交信息功能</a>
			</p>	 -->	
		
			<div class="am-g wxapi_container">
				<div class="am-u-sm-12 lbox_close wxapi_form">
				
				<div class="am-cf am-padding-xs">
					<button  type="button" class="am-btn am-btn-danger am-round am-icon-list" onclick="unbindopinion()"> 查看他人申请清单</button>
				</div>
				<div class="am-u-sm-12 am-u-md-3">
					<div class="am-input-group am-input-group-sm">
						<input type="text" class="am-form-field" id="condition" placeholder="搜索设备/负责人"
							name="condition" value="${condition}"> <span class="am-input-group-btn">
							<button class="am-btn am-btn-default" type="button"
								onclick="search()">搜索</button>
						</span>
					</div>
				</div>
					<table
						class="am-table am-table-striped am-table-hover table-main">
						<thead>
							<tr>
								<th>序号</th>
								<th>设备</th>
								<th>负责人</th>
								<th>手机号</th>
								<th>操作</th>
							</tr>
						</thead>
						<tbody>
							<c:forEach var="it" items="${list}" varStatus="index">
							
								<tr>
									<td>${index.count+1}</td>
									<td>${it.devCode}</td>
									<td>${it.realName}</td>
									<td>${it.phonenumber}</td>
						
									<td>
										<div class="am-btn-toolbar">
											<div class="am-btn-group am-btn-group-xs">
												<a class="am-btn am-btn-default am-btn-xs am-text-secondary am-icon-unlink" onclick="applyUnbind('${it.modId}','${it.devId}','${it.facId}','${it.userId}')"><span class="am-icon-map-qrcode"></span>申请解绑</a>
											</div>
										</div>
									</td>
								</tr>
							</c:forEach>
						</tbody>
					</table>
					
					<hr />
				</div>
			</div>
			
		</div>
	</div>
	
	
	
	
	
	<script type='text/javascript'
		src='//g.alicdn.com/sj/lib/zepto/zepto.min.js' charset='utf-8'></script>
	<script type='text/javascript'
		src='//g.alicdn.com/msui/sm/0.6.2/js/sm.min.js' charset='utf-8'></script>
	<script type='text/javascript'
		src='//g.alicdn.com/msui/sm/0.6.2/js/sm-extend.min.js' charset='utf-8'></script>
		
	<script type="text/javascript">
		//这段script用来去一些不能再js文件里直接取但是又要在纯js文件里用的值
		
		var roleId="${sessionScope.user.role_id}";
		var mbasePath ="${basePath}";
		
		function applyUnbind(modId,deviceId,facId,userId){
			$.ajax({
				type:'post',
				dataType:'json',
				cache:false,
				data:{"modId":modId,"deviceId":deviceId,"facId":facId,"userId":userId},
				url:mbasePath+"/ajaxaddanotherunbind",
				success:function(data){
					alert(data);
				}
				
			});
		}
		
		function unbindopinion(){
			window.location.href=mbasePath+roleId+"/unbindopinion";
		}
		
		//搜索
		function search(){
			window.location.href=mbasePath+roleId+"/applyunbind?condition="+$('#condition').val();
		}
	</script>	
		

		
</body>
</html>